/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.res0w.SMMS.ds;

import com.res0w.SMMS.factory.DataBaseOperate;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author res0w
 * @since 2009-9-22
 * @version 0.1
 */
public class SettingScore implements BatchSqlInterface {

    public int maxScore = 0;
    public int minScore = 0;
    public int peopleCount = 0;
    public int bScRecord = 0;

    public String[] exeSqls() {
        String[] sqls = new String[4];
        sqls[0] = "update setting_score set maxScore='" + this.maxScore + "'";
        sqls[1] = "update setting_score set minScore='" + this.minScore + "'";
        sqls[2] = "update setting_score set peopleCount='" + this.peopleCount + "'";
        sqls[3] = "update setting_score set bScRecord='" + this.bScRecord + "'";

        return sqls;
    }

    public void readSqls() {
        try {
            DataBaseOperate db=new DataBaseOperate();
            ResultSet rs = null;
            String sql = null;
            sql = "select * from setting_score";
            rs = db.dbQueryMuti(sql);
            while (rs.next()) {
                maxScore = Integer.parseInt(rs.getString(1));
                minScore = Integer.parseInt(rs.getString(2));
                peopleCount = Integer.parseInt(rs.getString(3));
                bScRecord = Integer.parseInt(rs.getString(4));
            }
            db.dbClosed();
        } catch (SQLException ex) {
            Logger.getLogger(SettingScore.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    /*测试模块
    public static void main(String[] args) {
    SettingScore ss=new SettingScore();
    for (int i = 0; i < ss.exeSqls().length; i++) {
    System.out.println(ss.exeSqls()[i]);
    }
    DataBaseOperate db=new DataBaseOperate();
    ss.readSqls(db);
    System.out.println(ss.maxScore);
    System.out.println(ss.minScore);
    System.out.println(ss.peopleCount);
    System.out.println(ss.bScRecord);
    }
     */
}
